Fixed #18157 - only partial information stored on group save if lower max_input_vars and/or max_multipart_body_parts
#18170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Boy, this was a real pain to figure out. (Thanks for the rubber-ducking, @uberbrady).
For some users, adding over 995 or so users via the
Admin Users > Groupsform would cause permissions to break in very strange ways, and their additional users wouldn't get added.This was due to a php.ini setting that would limit the number of form fields that PHP will accept - and instead of throwing an error, it unhelpfully just truncates the values:
The 1000 limit was why the number seemed to always be stuck at 995.
Because there's no way to set that value dynamically (outside of using
request_parse_body(), which does not buffer to the PHP input stream and could cause other issues), and because of the way PHP truncates this stuff, we had to do some javascript trickery to force the selected IDs into a hidden field so that it only counts as one field, which we then decipher in the controllers. It's janky, but short of asking every user to twiddle their PHP settings, this was the only safe way to handle the problem.This also makes the UI for the add/remove a little nicer, although I'm sure some folks will complain anyway. We could try to add a search filter to the lists as well in a different PR, to make it easier to find specific users within very large lists, but that's a problem for another time, I think.
There's one small glitch where the unselected "add these users" entries don't get saved (because they become unselected) if you click around a bunch - working on that.
Screen.Recording.2025-11-06.at.8.45.26.PM.mov
Fixes #18157